# -*- encoding: utf-8 -*-
'''
@File    :   do_dict_input.py
@Time    :   2022/11/11 17:43:58
@Author  :   Cms 
@Version :   1.0
@Contact :   2267000140@qq.com
@WebSite    :   www.baidu.com
'''

# here put the import lib
import collections

def myfunc(arg1):
    for i in arg1:
        i['name'] = input("请输入姓名：")
        i['city'] = input("请输入城市：")
        i['age'] = input("请输入年龄：")
    arg1.sort(key=lambda x:x['age'])#对字典按照年龄进行排序
    print(arg1)

list1 = []
dict1 ={"name":"1","city":"2","age":"3"}
dict2 ={"name":"1","city":"2","age":"3"}
list1.append(dict1)
list1.append(dict2)


myfunc(list1)